package com.usian.user.controller;

import com.usian.apis.user.ApUserRealnameControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.user.service.ApUserRealnameService;
import com.usian.utils.common.contants.user.AdminConstans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class AdUserRealnameController implements ApUserRealnameControllerApi {
    @Autowired
    private ApUserRealnameService userRealnameService;
    @Override
    @PostMapping("/list")
    public ResponseResult loadListByStatus(AuthDto dto) {
        return userRealnameService.lpadListByStatus(dto);
    }

    @PostMapping("/authPass")
    public  ResponseResult idEntityPass(@RequestBody AuthDto dto){
        //通过
        return userRealnameService.updateStatus(dto, AdminConstans.AUTHOR_TYPE);
    }
    //审核失败
    @PostMapping("/authFail")
    public ResponseResult idEntityFail(@RequestBody AuthDto dto){
        //2
        return userRealnameService.updateStatus(dto,AdminConstans.FAIL_AUTH);
    }
}
